﻿namespace Okazuki.BehaviorSupport.Design.Commons
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Microsoft.Windows.Design;
    using System.Windows;

    public static class AssemblyReferencesExtensions
    {
        public static IEnumerable<Type> GetTypesHasDefaultConstructor(this AssemblyReferences self, Type targetBaseType)
        {
            return self.GetTypes(targetBaseType)
                .Where(type => !type.IsGenericType)
                .Where(type => !type.IsAbstract)
                .Where(type => type.GetConstructor(Type.EmptyTypes) != null);
        }
    }
}
